package com.eos.control.action.activity;

import com.eos.business.service.SysActivityBusinessService;
import com.eos.common.tool.ConstantTool;
import com.eos.common.tool.ObjectUtils;
import com.eos.control.action.base.AbstractBaseAction;
import com.eos.orm.mybatis.model.ActivtyMappSales;
import com.eos.orm.mybatis.model.SysUser;

public class DeleteModelSalesSetAction extends AbstractBaseAction {
	private static final long serialVersionUID = 473707488964694314L;
	private Integer activitySalesId;

	public void setActivitySalesId(Integer activitySalesId) {
		this.activitySalesId = activitySalesId;
	}

	@Override
	public String execute() {
		try {
			SysUser user = (SysUser) getSession().getAttribute("SysUser");
			String userId = user.getId()+"";
			ActivtyMappSales ams = new ActivtyMappSales();
			ams.setId(activitySalesId);
			ams.setDealFlag(ConstantTool.DEAL_FLAG_FAIL);
			ams.setModifyTime(ObjectUtils.formatDate(null, "yyyy-MM-dd HH:mm:ss"));
			ams.setUpdateUserId(userId);
			SysActivityBusinessService sabs = new SysActivityBusinessService();
			String exeStatus = sabs.udpateActivitySales(ams);
			if("SUCCESS".equals(exeStatus)){
				statusCode = "200";
				message = "删除型号套餐关系信息成功!"; 
			}else{
				statusCode = "300";
				message = "系统繁忙, 删除型号套餐关系信息失败!";
			}
		} catch (Exception e) {
			e.printStackTrace();
			statusCode = "300";
			message = "系统异常, 删除型号套餐关系信息失败!";
		}
		return SUCCESS;
	}
}
